<?php

// connect to database
$conn_str = 'host=dbsrv1.cdf.toronto.edu dbname=csc309g23 user=csc309g23 password=ipheid5h';
$conn = pg_connect($conn_str);

// query database
$query = 'SELECT * FROM members WHERE username=\'' . $_GET['username'] . '\'';
$result = pg_query($conn, $query);

if (pg_num_rows($result) == 0) {
	echo 1;
} else {
	echo 0;
}

?>